package d0319;

import java.io.File;
import java.io.IOException;

public class LianXi {

        public static void main(String[] args) {
            LianXi lianXi=new LianXi();
            lianXi.create("src/d0319/dir","1.txt");
        }
        void create(String path,String fileName){
            File dir=new File(path);
            if(!dir.isDirectory()){
                dir.mkdir();
            }
            File f=new File(path+File.separator+fileName);
            try{
                System.out.println(f.createNewFile()==true?"创建成功":"创建失败");
            }catch(IOException e){
                e.printStackTrace();
            }
        }

    }